package ink.metoo.auto.fishpi.chatroom.command

import ink.metoo.auto.fishpi.call.ChatRoomCall
import ink.metoo.auto.fishpi.chatroom.Message

class RevokeMessageCommand : Command {

    override val commandText: String = "/撤回"

    override fun isMatch(message: Message): Boolean {
        return super.isMatch(message) && message.isMe
    }

    override fun execute(message: Message) {
        val commandParams = message.commandParams
        val oId = commandParams.getOrNull(1) ?: return
        ChatRoomCall.revokeMessage(oId = oId)
    }

}